<?php echo $session->flash(); ?>
<table border="0" cellspacing="8">
    <tbody>
        <tr>
            <td><?php echo $this->Html->link('Generar carta subsanaciones', array('controller' => 'Proyects', 'action' => 'subsanaciones', $id), array('target' => 'blank')); ?></td>
            <td><?php echo $this->Html->link('Generar carta Habilitado o Rechazado', array('controller' => 'Proyects', 'action' => 'result_letter_recalification', $id), array('target' => 'blank')); ?></td>
            <td><?php //echo $ajax->link("Ingresar subsanaciones", array('controller' => 'CorrectionLetters', "action" => "index", $id), array('update' => 'content', 'complete' => '', 'indicator' => 'loading0', 'class' => 'actions'));           ?></td>
            <td><?php
if (!empty($requisitos))
//Esta opción solo sale cuando hay requisitos del proyecto que esten en la reclamación.
    echo $ajax->link("Calificar Requisitos de proyecto", array('controller' => 'ProyectRequirements', "action" => "reevaluation_index", $id), array('class' => 'actions', 'update' => 'content', 'complete' => '', 'indicator' => 'loading0'));
?></td>
        </tr>
    </tbody>
</table>


<div id="loading0" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>


<?php
if (!empty($requisitos1)):
    ?>
    <table border="1" width="100%">
        <thead>
            <tr>
                <th align="center">
        <h1>RECLAMACIONES ASPIRANTES <? echo $cod ?></h1>
    </th>
    </tr>
    </thead>
    </table>
    <table id="tabla" class="tabla"  >
        <thead>
            <tr>
                <th>ID</th>
                <th>DOCUMENTO</th>
                <th>PRIMER NOMBRE</th>
                <th>PRIMER APELLIDO</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($requisitos1 as $requisito1): ?>
                <tr>
                    <td><?php echo $requisito1['Candidate']['id'] ?></td>
                    <td><?php echo $requisito1['Candidate']['nro_ident'] ?></td>
                    <td><?php echo $requisito1['Candidate']['1er_nombre'] ?></td>
                    <td><?php echo $requisito1['Candidate']['1er_apellido'] ?></td>
                    <td><?php echo $ajax->link("Calificar", array('controller' => 'CandidateRequirements', "action" => "reevaluation_index", $requisito1['Candidate']['id'], $id), array('update' => 'content', 'complete' => '', 'indicator' => 'loading0')) ?></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

<?php endif; ?>

<?php
if (!empty($requisitos2)):
    ?>
    <div id="loading1" style="display: none;">
        <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
    </div>
    <br>
    <br>
    <table border="1" width="100%">
        <thead>
            <tr>
                <th><h1>RECLAMACIONES PARA PREDIOS<?php echo $cod ?></h1></th>
    </tr>
    </thead>
    </table>
    <table id="tabla" class="tabla"  >
        <thead>
            <tr>
                <th>CODIGO</th>
                <th>NOMBRE</th>
                <th>Opciones</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($requisitos2 as $requisito2): ?>
                <tr>
                    <td><?php echo $requisito2['Property']['codigo'] ?></td>
                    <td><?php echo $requisito2['Property']['nombre'] ?></td>
                    <td><?php echo $ajax->link("Calificar", array('controller' => 'PropertyRequirements', "action" => "reevaluation_index", $requisito2['Property']['id'], $id), array('update' => 'content', 'complete' => '', 'indicator' => 'loading1')) ?></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <br>
<?php endif; ?>
</br>


<div id="loadw" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<table id="tabla" class="tabla"  >
    <thead>
        <tr>
            <th>CODIGO</th>
            <th>NOMBRE</th>
            <th>Opciones</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($titulos as $titulo): ?>
            <tr>
                <td><?php echo $titulo['Property']['codigo'] ?></td>
                <td><?php echo $titulo['Property']['nombre'] ?></td>
                <td><?php echo $ajax->link("Estudios de títulos", array('controller' => 'TitleStudies', "action" => "title_index", $titulo['Property']['id']), array('update' => 'content', 'complete' => '', 'indicator' => 'loadw')) ?></td>
            </tr>
        <?php endforeach; ?>

    </tbody>
</table>
<br>
<br>

<div id="loadz" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<table id="tabla" class="tabla"  >
    <thead>
        <tr>
            <th>CONCEPTO GENERAL DEL PROYECTO</th>
            <th>CALIFICACIÓN</th>
            <th colspan="3">Opciones</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><?php echo $decision['Claim']['concepto_territorial'] ?></td>
            <td><?php
    if ($decision['Claim']['calificacion_territorial'] == 'Cumple') {
        echo "Habilitado";
    } else if ($decision['Claim']['calificacion_territorial'] == 'No cumple') {
        echo "Rechazado";
    } else {
        echo $decision['Claim']['calificacion_territorial'];
    }
    ?></td>
            <td><?php echo $ajax->link("Editar", array('controller' => 'Claims', "action" => "territorial_calification", $decision['Claim']['id']), array('update' => 'content', 'complete' => '', 'indicator' => 'loadz')) ?></td>
            <td></td>
            <td></td>
        </tr>
    </tbody>
</table>

<?php echo $ajax->link($html->image("regresar.gif", array('width' => '30', 'heigth' => '30', 'alt' => 'regresar', 'align' => 'center')), array('controller' => 'Claims', "action" => "index"), array('escape' => false, 'update' => 'content', 'complete' => '', 'indicator' => 'loadz')); ?>